Skip to content

Improved LiDAR response time#122

Merged
jonyMarino merged 1 commit intomainfrom
IAMAI/increase_lidar_rate
Mar 11, 2026
Merged

Improved LiDAR response time#122
jonyMarino merged 1 commit intomainfrom
IAMAI/increase_lidar_rate

Conversation

@jonyMarino
Copy link
Contributor

Fixes: #

About

This pull request refactors the Unreal Lidar sensor implementation to improve performance, memory usage, and code clarity. The most significant changes include switching several sensor data buffers to use more efficient data types, optimizing buffer allocation and resizing, and simplifying the handling of laser trace parameters and simulation logic.

Performance and memory optimizations

  • Changed ReturnCloud from std::vector<bool> to std::vector<uint8_t> for improved memory efficiency and easier buffer management.
  • Replaced repeated buffer insertions with resize and reserve calls for sensor data arrays (e.g., PointCloud, AzimuthElevationRangeCloud, SegmentationCloud, IntensityCloud, LaserIndexCloud, ReturnCloud) to avoid unnecessary reallocations and improve performance. [1] [2]
  • Updated logic to count and preallocate only for valid laser returns, further reducing memory usage during filtering.

Code clarity and correctness

  • Refactored the ShootSingleLaser function to accept precomputed FCollisionQueryParams and use cached lidar range, improving readability and correctness. [1] [2] [3] [4]
  • Removed unnecessary mutex locking in the parallel laser simulation, as buffer writes are now thread-safe due to preallocation and index-based access. [1] [2] [3] [4]

Minor improvements

  • Added missing includes for <cstdint> and <memory> to support new buffer types and usage.
  • Ensured debug point drawing logic uses the correct buffer and synchronization primitives. [1] [2]
  • Fixed a bug where intensity values were incorrectly copied into the laser index buffer during pending report population.

How Has This Been Tested?

Screenshots and videos (if appropriate):

@jonyMarino jonyMarino added enhancement New feature or request sensors labels Mar 4, 2026
@jonyMarino jonyMarino merged commit c7b2e54 into main Mar 11, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request sensors

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant